`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    16:39:33 03/27/2014 
// Design Name: 
// Module Name:    position_generation 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module position_generation(	clk,
										new_enemy_1,//enemy1 generation signal
										new_enemy_2,//enemy2 generation signal
										new_enemy_3,
										new_enemy_4,
										new_enemy_5,
										new_enemy_6,
										new_bullet_1,
										cha_pos_x,//character position signal
										cha_pos_y,
										position_x_1,
										position_y_1,
										position_x_2,
										position_y_2,
										position_x_3,
										position_y_3,
										position_x_4,
										position_y_4,
										position_x_5,
										position_y_5,
										position_x_6,
										position_y_6,
										position_bullet_x,
										position_bullet_y,
										position_valid_1, //if enemy is in the right range
										position_valid_2, //if enemy is in the right range
										position_valid_3,
										position_valid_4,
										position_valid_5,
										position_valid_6,
										position_valid_7);//if bullet is in the right range

input clk,new_enemy_1,new_enemy_2,new_enemy_3,new_enemy_4,new_bullet_1,new_enemy_5,new_enemy_6;
input [9:0] cha_pos_x,cha_pos_y;
output [9:0]	position_x_1,
					position_y_1,
					position_x_2,
					position_y_2,
					position_x_3,
					position_y_3,
					position_x_4,
					position_y_4,
					position_x_5,
					position_y_5,
					position_x_6,
					position_y_6,
					position_bullet_x,
					position_bullet_y;
output position_valid_1, position_valid_2,position_valid_3,position_valid_4,position_valid_5;
output position_valid_6, position_valid_7;
wire [15:0] rand;

rand random_generation(			.clk(clk),
										.rand(rand));

enemy enemy_1(						.clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_1),
										.position_x(position_x_1),
										.position_y(position_y_1),
										.position_valid(position_valid_1));   
										
enemy_AI_ripple enemy_3(		.clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_3),
										.position_x(position_x_3),
										.position_y(position_y_3),
										.position_valid(position_valid_4));
										
enemy_AI_line enemy_5(		   .clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_5),
										.position_x(position_x_5),
										.position_y(position_y_5),
										.position_valid(position_valid_6));
										
enemy_AI_stationary enemy_6(		.clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_6),
										.position_x(position_x_6),
										.position_y(position_y_6),
										.position_valid(position_valid_7));

enemy_AI_circle enemy_4(		.clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_4),
										.position_x(position_x_4),
										.position_y(position_y_4),
										.position_valid(position_valid_5));										


enemy_AI_track_cha enemy_2(	.clk(clk),
										.rand(rand),
										.new_enemy(new_enemy_2),
										.cha_pos_x(cha_pos_x),
										.cha_pos_y(cha_pos_y),
										.position_x(position_x_2),
										.position_y(position_y_2),
										.position_valid(position_valid_2));
										
enemy_bullet bullet_1		(	.clk(clk),
										.rand(rand),
										.new_bullet(new_bullet_1),
										.position_x(position_bullet_x), 
										.position_y(position_bullet_y),
										.position_valid(position_valid_3),
										.enemy_pos_x(enemy_pos_x),
										.enemy_pos_y(enemy_pos_y));

endmodule
